Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

deMapLoader.hpp

Go to the documentation of this file.
00001 ///////////////////////////////////////////////////////////////////////////////
00002 /// @file deMapLoader.hpp
00003 ///
00004 /// @brief Loader for Quake-style MAP files
00005 ///
00006 /// @author Assassin
00007 ///
00008 /// This file is the intellectual property of Novus Delta, LLC.. Usage of the
00009 /// contents of this file is subject to the Destiny3D Member License which
00010 /// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
00011 ///
00012 /// This file is distributed "AS IS" without warranty of any kind.  Novus
00013 /// Delta, LLC. does not guarantee the fitness of the contents of this file
00014 /// for any particular purpose.
00015 ///
00016 /// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
00017 ///
00018 /// <hr>
00019 ///                                 Change History
00020 /// <hr>
00021 ///
00022 /// @date Dec 2003
00023 /// @author Assassin
00024 /// @remarks Shifted into external CLI tool
00025 ///
00026 ///////////////////////////////////////////////////////////////////////////////
00027 
00028 #ifndef DEMAPLOADER_HPP
00029 #define DEMAPLOADER_HPP
00030 
00031 #define USING_DESTINY3D
00032 #define DESTINY3D_STATIC_LINK
00033 
00034 #include "Destiny3D.hpp"
00035 //#include "deFileSystem.hpp"
00036 //#include "deFile.hpp"
00037 //#include "deWorld.hpp"
00038 //#include "deScene.hpp"
00039 #include "deString.hpp"
00040 #include "deList.hpp"
00041 
00042 class IdeRenderTexture;
00043 
00044 namespace deMapConverter
00045 {
00046     const double Plane_Epsilon = 0.00001;
00047     const double Edge_Epsilon = 0.00001;
00048     
00049     // a brush plane with texture info
00050     struct BrushPlane_t
00051     {
00052         deVec3d Normal;
00053         deDouble Dist;
00054         deVec3d Axes[2];
00055         deFloat Offsets[2];
00056         deFloat Scales[2];
00057         long Texture;
00058     };
00059 
00060     // a brush face with texture info
00061     struct Face_t
00062     {
00063         Face_t():pNext(0){}
00064         Face_t(const Face_t& ref)
00065             :pNext(0),mVertices(ref.mVertices), Normal(ref.Normal), mTexture(ref.mTexture) {}
00066         struct Vert
00067         {
00068             deVec3d Pos;
00069             deTexCoord2 TexCoord;
00070         };
00071         long mTexture;
00072         deTArray<Vert> mVertices;
00073         deVec3d Normal;
00074         Face_t* pNext;
00075     };
00076     
00077     // a brush, composed of several planes intersected to form a convex hull of faces
00078     struct Brush_t
00079     {
00080         deTArray <BrushPlane_t> mPlanes;    // all planes used for brush
00081         deTArray <Face_t>       mFaces;     // all faces produced by brush
00082         deAABB BBox;
00083         deBoolean Invisible;
00084     };
00085     
00086     // a map entity - contains data and geometry
00087     struct Entity_t
00088     {
00089         struct entity_var_t
00090         {
00091             entity_var_t() {}
00092             entity_var_t(const deString2& name) : mName(name) {}
00093             deString2 mName;
00094             deString2 mValue;
00095         };
00096         deTArray <entity_var_t> mVars;
00097         deTList <Brush_t> mBrushes;
00098     };
00099     
00100     // the full map data
00101     struct FullData_t
00102     {
00103         deTList  <Entity_t>     mEntities;  // all entities, they include their brushes
00104         deTArray <IdeRenderTexture*> mTextures; // all textures used in the map
00105     };
00106 } // namespace deMapConverter
00107 
00108 void LogExportMsg(const char* format, ...);
00109 class mapException
00110 {
00111 public:
00112     deString2 what;
00113     mapException() {}
00114     mapException(const deString & msg) : what(msg.const_str()) {}
00115     mapException(const char * msg) : what(msg) {}
00116     ~mapException() {}
00117 };
00118 
00119 #endif

Generated on Mon Sep 12 19:58:30 2005 for Destiny3D by doxygen1.3-rc3